package com.dyh.quickdemozwei.beanCallBack;

import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;

@Service
@Slf4j
public class BeanCallBackBService {

    @Autowired
    BeanCallBackAService beanCallBackAService;


    interface CallBack{
        void process(int a,int b);
    }

    CallBack callBack = (a, b) -> {
        beanCallBackAService.print(a+b);
    };

    public void fun(int a){
       int b= beanCallBackAService.fun();
       callBack.process(a,b);
    }

    public static void main(String[] args) {

        HashMap map = new HashMap();

        List list = new ArrayList(map.keySet());

        System.out.println();

//        List<Integer> list = Lists.newArrayList(
//                1,2,3,4,5,6,7
//        );
//        Iterator<Integer> iterator = list.iterator();
//        while (iterator.hasNext()){
//            int obj = iterator.next();
//            if(4==obj || 6==obj){
//                iterator.remove();
//            }
//        }
//
//        System.out.println();
    }
}
